

import 'package:bt_tool/basic/bt_color_tool.dart';
import 'package:bt_tool/basic/bt_controller.dart';
import 'package:bt_tool/basic/bt_font_tool.dart';
import 'package:bt_tool/basic/bt_nav_tool.dart';
import 'package:bt_tool/basic/bt_theme_color.dart';
import 'package:bt_tool/widget/bt_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../controller/img_path_pick_folder_controller.dart';

class ImgPathPickFolderPage extends BTStatefulWidget{


  const ImgPathPickFolderPage({super.key,super.routerConfig});

  @override
  State<StatefulWidget> createState() {
    return ImgPathPickFolderState();
  }

}

class ImgPathPickFolderState extends BTState<ImgPathPickFolderPage>{

  final ImgPathPickFolderController controller = ImgPathPickFolderController();

  @override
  BTController btCtrl() {
    return controller;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: BTNavTool.createAppBar(
        title: "选择目标文件夹",
      ),
      body: ListView.builder(
        itemCount: controller.dataList.length,
        itemBuilder: (c,i){
          return GestureDetector(
            onTap: ()=> controller.itemClick(i),
            child: Column(
              children: [
                Container(
                  constraints: const BoxConstraints.expand(height: 45),
                  color: BTThemeColor.contentBgColor,
                  alignment: Alignment.centerLeft,
                  padding: const EdgeInsets.only(left: 15),
                  child: Text(
                    controller.dataList[i],
                    style: TextStyle(
                        fontSize: 18,
                        fontWeight: BTFontWeight.medium,
                        color: btHexColor("#333333")
                    ),
                  ),
                ),
                Divider(color: BTThemeColor.dividerColor,height: 1,),
              ],
            ),
          );
        },
      ),
    );
  }

}